package puzzeldoolhof;

public class State 
{
	private Position my_position1;
	private Position my_position2;
	
	public State(Position position1, Position position2)
	{
		if(position1.getNummer() < position2.getNummer())
		{
			my_position1 = position1;
			my_position2 = position2;
		}
		else
		{
			my_position1 = position2;
			my_position2 = position1;
		}
	}
	
	public String toString()
	{
		return my_position1.toString() +"|"+my_position2.toString();
	}
	
	public boolean equals( Object object )
	{
		State state = (State) object;
		
		return state != null && hashCode() == state.hashCode();
	}
	
	public int hashCode()
	{
		return 1000 * my_position1.hashCode() + my_position2.hashCode();
	}
	
	public Position getPosition1()
	{
		return my_position1;
	}
	
	public Position getPosition2()
	{
		return my_position2;
	}
}

